package com.azkj.album.utils;

import android.text.InputFilter;
import android.text.Spanned;

public class InputFilterUtils {

    public static InputFilter getNoSpaceFilter() {
        InputFilter filter = new InputFilter() {
            @Override
            public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
                if (source.equals(" ") || source.toString().contentEquals("\n")) {
                    return "";
                } else {
                    return null;
                }
            }
        };
        return filter;

    }
}
